#!/usr/bin/env python
# -*- coding: utf-8 -*-
""""""
__author__ = "Lei Chen <hide1713@gmail.com>"
import unittest
import sys
sys.path.append("../")
from src.cog_model import CogModel
from src.cog import Cog
from src.genome_record import GenomeRecord

class TestCogModel(unittest.TestCase):
    """Unit test for CogModel"""
    def setUp(self):
        cog = Cog("my_cog", 20, "H", "test cog")
        cog_map = {"my_cog":cog}
        self.model = CogModel("test_file", cog_map)

    def tearDown(self):
        self.model.clean_data()
        
    def test_hit_range(self, ):
        """
        """
        record = GenomeRecord("read_name", "my_cog", 5, 10, 100)
        self.model.add_genome_records([record])
        length, range_list = self.model.get_cog_range("my_cog")
        self.assertEqual(length,20)
        self.assertEqual(range_list[0],("read_name", 5, 10, 100))

  
if __name__ == '__main__':
    unittest.main()

